home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 December / Australian PC User - December 2003 (CD2).iso / software / apps / files / dwmx2k4.exe / Disk1 / data1.cab / Configuration_En / Objects / Media / Flash.js < prev    next >
Encoding:
JavaScript  |  2003-09-05  |  1.9 KB  |  70 lines

  1. // Copyright 2001, 2002, 2003 Macromedia, Inc. All rights reserved.
  2. function isDOMRequired() { 
  3.   // return true.  This will insert the object into the design view.
  4.   return true;
  5. }
  6.  
  7. function isAsset() {
  8.     return true;
  9. }
  10.  
  11. function objectTag(assetArgs)
  12. {
  13.     var bDialogState = dw.getShowDialogsOnInsert();
  14.  
  15.     // Return the html tag that should be inserted
  16.  
  17.     var theMovie = '';
  18.  
  19.     if (dw.appName == "Contribute")
  20.     {
  21.         var filter = new Array(dw.loadString("insert doc dialog/flash doc desc") + " (*.swf)|*.swf|");
  22.         theMovie = dw.browseForFileURL("open", "", false, "", filter, "", "", "desktop");
  23.     }
  24.     else
  25.     {
  26.         theMovie = dw.browseForFileURL();
  27.     }
  28.     
  29.     if (theMovie != '')
  30.     {
  31.         theMovie = dw.doURLEncoding(theMovie);
  32.     }
  33.  
  34.     if (assetArgs)
  35.     {
  36.         theMovie = assetArgs;
  37.     }
  38.  
  39.     if ((theMovie == '') && bDialogState)
  40.     {
  41.         return '';
  42.     }
  43.  
  44.     rtnStr = '<OBJECT CLASSID="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + 
  45.                 ' CODEBASE="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" WIDTH="32" HEIGHT="32">\n' + 
  46.                 '<PARAM NAME="movie" VALUE="' + theMovie + '"> <PARAM NAME="quality" VALUE="high">\n' +
  47.                 '<EMBED SRC="' + theMovie +
  48.                 '" quality="high" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" ' +
  49.                 'TYPE="application/x-shockwave-flash" WIDTH="32" HEIGHT="32">'+
  50.                 '</EMBED></OBJECT>';
  51.  
  52.     prefsAccessibilityOption = dw.getPreferenceString("Accessibility", "Accessibility Media Options", "");
  53.  
  54.     if (prefsAccessibilityOption == 'TRUE')
  55.     {
  56.         rtnStr = addAccessibility(rtnStr);
  57.     }
  58.  
  59.     return rtnStr;
  60. }
  61.  
  62.  
  63. function addAccessibility(rtnStr) {
  64.    var cmdFile = dreamweaver.getConfigurationPath() + "/Commands/Object Options.htm";
  65.    var cmdDOM = dreamweaver.getDocumentDOM(cmdFile);
  66.  
  67.    cmdDOM.parentWindow.setFormItem(rtnStr);
  68.    dreamweaver.popupCommand("Object Options.htm");
  69.    return (cmdDOM.parentWindow.returnAccessibilityStr(rtnStr));    
  70. }